package
{
	import com.cambright.lotusroot;
	import com.cambright.lotusroot.Application;
	
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.filesystem.File;
	
	public class Main extends Sprite
	{
		public function Main()
		{
			loaderInfo.addEventListener(Event.COMPLETE, _main);
		}
		
		private function _main(event:Event):void
		{
			loaderInfo.removeEventListener(Event.COMPLETE, _main);
			
			var application:Application = lotusroot.startUp(this);
			
			var libraryFolder:File = File.applicationDirectory.resolvePath("libs");
			application.addLibrary(libraryFolder.resolvePath("com.cambright.swc"));
			application.addLibrary(libraryFolder.resolvePath("com.cambright.lotusroot.swc"));
			application.addLibrary(libraryFolder.resolvePath("com.cambright.mixpaint.swc"));
			application.addLibrary(libraryFolder.resolvePath("com.cambright.stack.swc"));
			
			var assetFolder:File = File.applicationDirectory.resolvePath("assets");
			application.addLibrary(assetFolder.resolvePath("huachenxing.mimi520.skin.swc"));
			application.addLibrary(assetFolder.resolvePath("huachenxing.mimi520.resource.swc"));
			
			var moduleFolder:File = File.applicationDirectory.resolvePath("mods");
			application.addLibrary(moduleFolder.resolvePath("huachenxing.mimi520.main.swc"));
			application.addLibrary(moduleFolder.resolvePath("huachenxing.mimi520.option.swc"));
			application.addLibrary(moduleFolder.resolvePath("huachenxing.mimi520.brower.swc"));
			
			application.installModule("huachenxing.mimi520.main.Module");
			application.installModule("huachenxing.mimi520.option.Module");
			application.installModule("huachenxing.mimi520.brower.Module");
		}
	}
}